<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ReferenceError</title>
    <style>
        * {
            font-size: 28px;
        }
    </style>
</head>

<body>

    <button type="button" id="btnEx">执行</button>

    <script>
        btnEx.onclick = function () {
            try {
                var a = xyz;
            } catch (e) {
                console.log('e instanceof ReferenceError:', e instanceof ReferenceError);
                console.log('e.message:', e.message);
                console.log('e.name:', e.name);
                console.log('e.fileName:', e.fileName);
                console.log('e.lineNumber:', e.lineNumber);
                console.log('e.columnNumber:', e.columnNumber);
                console.log('e.stack:', e.stack);
            }
        }
    </script>
</body>